package bit2;

import java.util.*;

public class bitMain5 {
    public static void main1(String[] args) {
        Map<String,String> map=new HashMap<>();
        map.put("法外狂徒","张三");
        map.put("海南军阀","漠叔");
        System.out.println(map);
        System.out.println(map.get("海南军阀"));
        map.put("西游记","吴承恩");
        map.put("三国演义","罗贯中");
        map.put("红楼梦","曹雪芹");
        System.out.println(map.size());
        String v=map.getOrDefault("假面骑士","空我");
        System.out.println(v);
        System.out.println(map);
        System.out.println(map.containsKey("法外狂徒"));
        System.out.println(map.containsValue("漠叔"));
        System.out.println("=====================");
        System.out.println(map.size());
        System.out.println("=====================");
        Set<Map.Entry<String ,String>> entrySet=map.entrySet();
        for (Map.Entry<String,String> entry:entrySet) {
            System.out.println("key-> " + entry.getKey()+" value-> " + entry.getValue());
        }
    }
    public static void main2(String[] args) {
        Collection<String> collection=new ArrayList<>();
        collection.add("hello1");
        collection.add("hello2");
        collection.add("hello3");
        System.out.println(collection);
        for (String str:collection) {
            System.out.println(str);
        };
    }

    public static void main(String[] args) {
        Stack<Integer> one=new Stack<>();
        one.add(0);
        one.add(1);
        one.add(2);
        one.add(3);
        one.add(4);
        one.add(5);
        one.add(6);
        one.add(7);
        System.out.println(one.pop());
        System.out.println(one.peek());
    }
}
